package com.cskaoyan.config.lihaoming;

import com.cskaoyan.bean.lihaoming.BaseRespVo2;
import com.cskaoyan.bean.lihaoming.BaseRespVo3;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author lihaoming
 * @Description:全局类型转换异常处理
 * @Create 2022-06-26 21:13
 * @Version
 */
@ControllerAdvice
public class CustomExceptionControllerAdvice {
    @ExceptionHandler(NumberFormatException.class)
    @ResponseBody
    public BaseRespVo3 method(NumberFormatException e){
        return BaseRespVo3.error();
    }

}
